<template>
  <j-modal
    title="选择事件类型"
    :width="600"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <defuseSelect ref="defuseSelect" />
  </j-modal>
</template>
<script>
import defuseSelect from '../../varied/Types'
export default {
  components: { defuseSelect },
  data() {
    return {
      visible: false,
      model: {},
      formItemLayout: {
        labelCol: {
          xs: { span: 24 },
          sm: { span: 4 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 18 }
        }
      }
    }
  },
  methods: {
    show(id) {
      console.log('id:' + id)
      this.visible = true
    },
    handleOk() {
      this.$refs.defuseSelect.$refs.ruleForm.validate(valid => {
        if (valid) {
          this.$refs.defuseSelect.turnRound()
          this.handleCancel()
        } else {
          return false
        }
      })
    },
    handleCancel() {
      this.model = {}
      this.visible = false
    }
  }
}
</script>
<style lang="less" scoped></style>
